import { createRouter, createWebHashHistory } from 'vue-router';
import ReportView from '../views/ReportView.vue';
import CheckView from '../views/CheckView.vue';

import NormalRouterView from '../views/NormalRouterView.vue';
import GXView from '../views/GXView.vue';
import AdjustView from '../views/AdjustView.vue';
import RANK_PView from '../views/RANK_PView.vue';
import GX_PView from '../views/GX_PView.vue';

const routes = [
  {
    path: "/",
    name: "input",
    component: NormalRouterView,
    meta: {
      routers: [
        {
          link: '/input/report',
          text: '工时填报',
        },
        {
          link: '/input/check',
          text: '工时统计',
        },
        // {
        //   link: '/maintain/GX_P',
        //   text: '人员工序维护',
        // },
        // {
        //   link: '/sumSupplie/jsjl',
        //   text: '寄售备库率记录',
        // },
        // {
        //   link: "/sumSupplie/rateMaintain",
        //   text: "供应商寄售比例维护",
        // },
      ],
    },
    children: [
      {
        path: "/input/report",
        name: "report",
        component: ReportView,
      },
      {
        path: "/input/check",
        name: "CheckView",
        component: CheckView,
      },
      // {
      //   path: "/maintain/GX_P",
      //   name: "GX_PView",
      //   component: GX_PView,
      // },
    ],
  },
  {
    path: "/maintain",
    name: "maintain",
    component: NormalRouterView,
    meta: {
      routers: [
        {
          link: '/maintain/Adjust',
          text: '月度工时调整',
        },
        {
          link: '/maintain/GX',
          text: '工序维护',
        },
        {
          link: '/maintain/RANK_P',
          text: '人员等级维护',
        },
        {
          link: '/maintain/GX_P',
          text: '人员工序维护',
        },
        // {
        //   link: '/sumSupplie/jsjl',
        //   text: '寄售备库率记录',
        // },
        // {
        //   link: "/sumSupplie/rateMaintain",
        //   text: "供应商寄售比例维护",
        // },
      ],
    },
    children: [
      {
        path: "/maintain/Adjust",
        name: "Adjust",
        component: AdjustView,
      },
      {
        path: "/maintain/GX",
        name: "GX",
        component: GXView,
      },
      {
        path: "/maintain/RANK_P",
        name: "RANK_PView",
        component: RANK_PView,
      },
      {
        path: "/maintain/GX_P",
        name: "GX_PView",
        component: GX_PView,
      },
      // {
      //   path: "/sumSupplie/jsjl",
      //   name: "jsjl",
      //   component: JSRecordView,
      // },
      // {
      //   path: "/sumSupplie/rateMaintain",
      //   name: "rateMaintain",
      //   component: SupplieRateMaintain,
      // },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes
});

export default router;
